Draft
Conversation
mys007
reviewed
Nov 4, 2025
src/template_formatting/formatter.py
Outdated
| } | ||
| ) | ||
| if "date_string" not in template_kwargs: | ||
| template_kwargs["date_string"] = "1 Jan 2025" # hardcoded date for consistency in tests |
Contributor
There was a problem hiding this comment.
I'm not sure about the date choice, it may affect tests from the future. How about "unknown" or "not available"?
Collaborator
Author
There was a problem hiding this comment.
maybe "unknown" would work
but there is also a risk that this is OOD; the default is using "26 Jul 2024" unless it is defined or the strftime is defined
# https://raw.githubusercontent.com/huggingface/transformers/refs/heads/main/src/transformers/models/llama4/processing_llama4.py
{%- if not date_string is defined %}\n
{%- if strftime_now is defined %}\n
{%- set date_string = strftime_now(\"%d %b %Y\") %}\n
{%- else %}\n
{%- set date_string = \"26 Jul 2024\" %}\n
{%- endif %}
Contributor
There was a problem hiding this comment.
I guess that's highly model specific, though...
Collaborator
Author
|
note: this PR needs to be tested before merging to ensure there is no unwanted effect:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
/docs/).What type of PR is this? (check all applicable)
Description
Related Tickets & Documents
QA Instructions, Screenshots, Recordings
Please replace this line with instructions on how to test your changes, a note
on the hardware and config this has been tested on, as well as any relevant
additional information.
Added/updated tests?
have not been included
[optional] Are there any post deployment tasks we need to perform?